package com.qf.service.impl;

import com.qf.dao.jpa.OrdersJpa;
import com.qf.dao.OrdersMapper;
import com.qf.entity.Orders;
import com.qf.service.OrdersService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class OrdersServiceImpl implements OrdersService {

    @Resource
    private OrdersJpa ordersJpa;

    @Resource
    private OrdersMapper ordersMapper;

    @Override
    public Orders insertOne(Orders orders) {
        return ordersJpa.saveAndFlush(orders);
    }

    @Override
    public List<Orders> getAllUnManageOrders() {
        return ordersMapper.getAllUnManageOrders();
    }

    @Override
    public List<Orders> getAllUnPayOrders() {
        return ordersMapper.getAllUnPayOrders();
    }

    @Override
    public List<Orders> getAllFinishOrders() {
        return ordersMapper.getAllFinishOrders();
    }

    @Override
    public void gethandleOrders(Integer oid) {
        ordersMapper.gethandleOrders(oid);
    }

    @Override
    public int deleteOrders(Integer oid) {
        return ordersMapper.deleteOrders(oid);
    }
}
